Skip to content

support unix endpoint path with more than 104 bytes with chdir#17

Merged
samuel-williams-shopify merged 8 commits intosocketry:mainfrom
dsh0416:dsh0416/support-unix-endpoint-104
Jan 29, 2026
Merged

support unix endpoint path with more than 104 bytes with chdir#17
samuel-williams-shopify merged 8 commits intosocketry:mainfrom
dsh0416:dsh0416/support-unix-endpoint-104

Conversation

@dsh0416
Copy link
Contributor

@dsh0416 dsh0416 commented May 27, 2025

No description provided.

@samuel-williams-shopify
Copy link
Contributor

samuel-williams-shopify commented May 30, 2025

We cannot use the implementation that changes the current working directory for the process because it's likely to cause unexpected behaviour for any code that's using relative file paths at the same time.

I suggest using a different approach. If the path is too long, construct a temporary socket path, e.g. $tmpdir/$checksum.ipc where $checksum is derived from the original path in a consistent way. Then, use that for bind and connect. In addition, create a symlink from the original path to the temporary socket path. This should be sufficient to have the same visible effects but allows us to use a shorter path for the socket address.

There are some other options like bindat/connectat but these are not standardised system calls unfortunately.

@dsh0416 dsh0416 force-pushed the dsh0416/support-unix-endpoint-104 branch from e4234fb to dda528f Compare January 14, 2026 10:05
@dsh0416 dsh0416 marked this pull request as draft January 14, 2026 10:50
@dsh0416 dsh0416 marked this pull request as ready for review January 14, 2026 11:22
@dsh0416
Copy link
Contributor Author

dsh0416 commented Jan 19, 2026

documentation updated.

@dsh0416 dsh0416 force-pushed the dsh0416/support-unix-endpoint-104 branch from 903d6a7 to 2918db4 Compare January 26, 2026 06:29
@samuel-williams-shopify samuel-williams-shopify force-pushed the dsh0416/support-unix-endpoint-104 branch from 2918db4 to 450c083 Compare January 29, 2026 05:36
Copy link
Contributor

@samuel-williams-shopify samuel-williams-shopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your efforts!

@samuel-williams-shopify samuel-williams-shopify merged commit 5775b45 into socketry:main Jan 29, 2026
21 of 24 checks passed
@dsh0416 dsh0416 deleted the dsh0416/support-unix-endpoint-104 branch January 30, 2026 00:02
@samuel-williams-shopify samuel-williams-shopify added this to the v0.17.2 milestone Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants